#! /usr/bin/env python

PACKAGE='dvo_slam'
import os
import roslib; roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator import *

me = os.path.realpath(__file__)
cpp_header = os.path.realpath(os.path.join(os.path.dirname(me), "cpp", PACKAGE, "KeyframeSlamConfig.h"))

if os.path.exists(cpp_header) and os.path.getmtime(me) < os.path.getmtime(cpp_header):
    exit(0)

gen = ParameterGenerator()

#       Name, Type, Reconfiguration level, Description, Default, Min, Max
gen.add("max_translational_distance",               double_t, 1, "", 0.3, 0, 10)
gen.add("max_rotational_distance",                  double_t, 1, "", 0, 0, 10)
gen.add("min_entropy_ratio",                        double_t, 1, "", 0.4, 0, 1.2)
gen.add("min_eq_sys_constraint_ratio",              double_t, 1, "", 0.3, 0, 1.2)
gen.add("constraint_search_radius",                 double_t, 1, "", 0.75, 0, 10)
gen.add("constraint_min_entropy_ratio_coarse",      double_t, 1, "", 0.7, 0, 2)
gen.add("constraint_min_entropy_ratio_fine",        double_t, 1, "", 0.9, 0, 2)
gen.add("constraint_min_eq_sys_constraint_ratio",   double_t, 1, "", 0.3, 0, 1.2)
gen.add("graph_opt_robust",                         bool_t,   1, "", False)
gen.add("graph_opt_iterations",                     int_t,    1, "", 20, 0, 500)
gen.add("graph_opt_dense_graph",                    bool_t,   1, "", False)
gen.add("graph_opt_remove_outliers",                bool_t,   1, "", False)
gen.add("graph_opt_outlier_weight_threshold",       double_t, 1, "", 0, 0, 1.0)
gen.add("graph_opt_min_distance",                   int_t,    1, "", 0, 0, 500)
gen.add("graph_opt_final",                          bool_t,   1, "", False)
gen.add("graph_opt_final_iterations",               int_t,    1, "", 1000, 0, 5000)
gen.add("graph_opt_final_dense_graph",              bool_t,   1, "", True)
gen.add("graph_opt_final_remove_outliers",          bool_t,   1, "", False)
gen.add("graph_opt_final_outlier_weight_threshold", double_t, 1, "", 0, 0, 1.0)
gen.add("use_multithreading",                       bool_t,   1, "", True)

exit(gen.generate(PACKAGE, "dvo", "KeyframeSlam"))
